<template>
    <!-- 优惠券库 -->
    <div class="container">
        <avue-form ref="form" v-model="disForm.data" :option="disForm.option" class="yz-form disKu"></avue-form>
        <!-- 标题栏 -->
        <el-row class="title">
            <el-col :span="18">库存记录
            <!-- 菜单 -->
            <el-row>
                <el-col :span="24" class="table-fun">
                    <img src="../../assets/imgs/operation_icon_shuaxin_default.png" alt="" class="lf"><div class="lf choose-title fun-text" @click="refresh">刷新</div>
                    <img src="../../assets/imgs/operation_icon_tianjia_default.png" alt="" class="lf"><div class="lf choose-title fun-text" @click="amWin=true;winTitle='添加'">入库</div>
                    <img src="../../assets/imgs/operation_icon_xiugai_default.png" alt="" class="lf"><div class="lf choose-title fun-text" @click="del">退库</div>
                </el-col>
            </el-row>
            <!-- 表格栏 -->
            <avue-crud :data="disTable.data" :option="disTable.option" :page="disTable.page"  @current-change="disPage" @current-row-change="rowchange"></avue-crud>
            </el-col>
            <el-col :span="6">明细

            </el-col>
        </el-row>
        
    </div>
</template>

<script>
export default {
    data(){
        return {
            disForm:{
                data:{},
                option:{
                    column:[
                        {
                            label:"名称",
                            prop:"name",
                            span:5
                        },
                        {
                            label:"入库时间",
                            prop:"inTime",
                            type:"datetimerange",
                            span:18
                        },
                    ]
                }
            },
            amWin:true,
            winTitle:"test",
            disTable:{
                page: {
                    pageSizes: [10],
                    total: 20,
                    currentPage: 1,
                    pageSize: 10,
                },
                data:[],
                option:{
                    menu:false,
                    page:true,
                    index:true,
                    highlightCurrentRow:true,
                    column:[
                        {
                            label:"名称",
                            prop:"batch_no"
                        },
                        {
                            label:"起始号",
                            prop:"begin_no"
                        },
                        {
                            label:"结束号",
                            prop:"end_no"
                        },
                        {
                            label:"数量",
                            prop:"counts"
                        },
                        {
                            label:"剩余",
                            prop:"used"
                        },
                        {
                            label:"入库操作用户",
                            prop:"create_name"
                        },
                        {
                            label:"入库操作时间",
                            prop:"update_time"
                        },
                    ]
                }
            },
            detailTable:{
                data:[],
                option:{
                    menu:false,
                    index:true,
                    column:[
                        {
                            label:"领用人",
                            prop:""
                        },
                        {
                            label:"起始号",
                            prop:"begin_no"
                        },
                        {
                            label:"结束号",
                            prop:"end_no"
                        },
                    ]
                }
            },
            currentRow:""
        }
    },
    methods:{
        disPage(val){
            this.disTable.page.currentPage=val;
            this.getDisTable();
        },
        getDisTable(){
            this.postRequest("/fin/bill/store/list",{
                rows:10,
                page:this.disTable.page.currentPage
            }).then(data=>{
                this.disTable.page.total=data.data.totalRow
                this.disTable.data=data.data.list
            })
        },
        refresh(){},
        add(){},
        del(){},
        rowchange(val){
            this.currentRow=val;
        }
    },
    computed:{},
    watch:{},
    components:{},
   mounted(){
       this.$emit("sendActive", "2-2");
       this.getDisTable();
   }
}
</script>
<style scoped src="../../assets/css/financeManage/discountKu.css">
</style>